package com.szrt.javaweb;

import javax.servlet.ServletRequestEvent;
import javax.servlet.ServletRequestListener;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

public class ListenerDemo implements HttpSessionListener,ServletRequestListener {
	
	
	
	
	/**
	 * 代表一个请求被创建出来  new
	 */
	@Override
	public void requestInitialized(ServletRequestEvent sre) {
		
		System.out.println("调用ListenerDemo的requestInitialized表示创建1个请求...");
	}

	/**
	 * 当服务给出相应之后，删除request
	 */
	@Override
	public void requestDestroyed(ServletRequestEvent sre) {
		System.out.println("调用ListenerDemo的requestDestroyed表示删除1个请求...");
	}


	/**
	 * 表示1个session的被创建
	 */
	@Override
	public void sessionCreated(HttpSessionEvent se) {
		System.out.println("调用ListenerDemo的sessionCreated表示创建1个session......");
	}

	
	/**
	 * 删除1个session的
	 */
	@Override
	public void sessionDestroyed(HttpSessionEvent se) {
		System.out.println("调用ListenerDemo的sessionDestroyed表示删除1个session......");
	}

}
